package main.controller;

import java.util.Observable;
import java.util.Observer;

/**
 * Adds a couple utility functions to subdue some code duplication.
 * @author kevingao
 *
 */
public class MVCObservable extends Observable {

    /**
     * Add a list of controllers to the current instance's observers.
     * @param controllers param list of observers
     */
    public MVCObservable (Observer ... controllers) {
        for (Observer o : controllers) {
            addObserver(o);
        }
    }

    protected void notifyObserversImmediately(MVCEvent e) {
        setChanged();
        notifyObservers(e);
    }
}
